<?php
	/**
	 * The abstract MantisProjectTableGen class defined here is
	 * code-generated and contains all the basic CRUD-type functionality as well as
	 * basic methods to handle relationships and index-based loading.
	 *
	 * To use, you should use the MantisProjectTable subclass which
	 * extends this MantisProjectTableGen class.
	 *
	 * Because subsequent re-code generations will overwrite any changes to this
	 * file, you should leave this file unaltered to prevent yourself from losing
	 * any information or code changes.  All customizations should be done by
	 * overriding existing or implementing new methods, properties and variables
	 * in the MantisProjectTable class.
	 *
	 * @package My QCubed Application
	 * @subpackage GeneratedDataObjects
	 * @property-read integer $Id the value for intId (Read-Only PK)
	 * @property string $Name the value for strName (Unique)
	 * @property integer $Status the value for intStatus (Not Null)
	 * @property integer $Enabled the value for intEnabled (Not Null)
	 * @property integer $ViewState the value for intViewState (Not Null)
	 * @property integer $AccessMin the value for intAccessMin (Not Null)
	 * @property string $FilePath the value for strFilePath (Not Null)
	 * @property string $Description the value for strDescription (Not Null)
	 * @property integer $CategoryId the value for intCategoryId (Not Null)
	 * @property integer $InheritGlobal the value for intInheritGlobal (Not Null)
	 * @property string $SvnPath the value for strSvnPath 
	 * @property string $FtpUrl the value for strFtpUrl 
	 * @property string $FtpWwwPath the value for strFtpWwwPath 
	 * @property string $FtpUser the value for strFtpUser 
	 * @property string $SvnWwwPath the value for strSvnWwwPath 
	 * @property string $FtpPass the value for strFtpPass 
	 * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new)
	 */
	class MantisProjectTableGen extends QBaseClass implements IteratorAggregate {

		///////////////////////////////////////////////////////////////////////
		// PROTECTED MEMBER VARIABLES and TEXT FIELD MAXLENGTHS (if applicable)
		///////////////////////////////////////////////////////////////////////

		/**
		 * Protected member variable that maps to the database PK Identity column mantis_project_table.id
		 * @var integer intId
		 */
		protected $intId;
		const IdDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.name
		 * @var string strName
		 */
		protected $strName;
		const NameMaxLength = 128;
		const NameDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.status
		 * @var integer intStatus
		 */
		protected $intStatus;
		const StatusDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.enabled
		 * @var integer intEnabled
		 */
		protected $intEnabled;
		const EnabledDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.view_state
		 * @var integer intViewState
		 */
		protected $intViewState;
		const ViewStateDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.access_min
		 * @var integer intAccessMin
		 */
		protected $intAccessMin;
		const AccessMinDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.file_path
		 * @var string strFilePath
		 */
		protected $strFilePath;
		const FilePathMaxLength = 250;
		const FilePathDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.description
		 * @var string strDescription
		 */
		protected $strDescription;
		const DescriptionDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.category_id
		 * @var integer intCategoryId
		 */
		protected $intCategoryId;
		const CategoryIdDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.inherit_global
		 * @var integer intInheritGlobal
		 */
		protected $intInheritGlobal;
		const InheritGlobalDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.svn_path
		 * @var string strSvnPath
		 */
		protected $strSvnPath;
		const SvnPathMaxLength = 250;
		const SvnPathDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.ftp_url
		 * @var string strFtpUrl
		 */
		protected $strFtpUrl;
		const FtpUrlMaxLength = 250;
		const FtpUrlDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.ftp_www_path
		 * @var string strFtpWwwPath
		 */
		protected $strFtpWwwPath;
		const FtpWwwPathMaxLength = 250;
		const FtpWwwPathDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.ftp_user
		 * @var string strFtpUser
		 */
		protected $strFtpUser;
		const FtpUserMaxLength = 45;
		const FtpUserDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.svn_www_path
		 * @var string strSvnWwwPath
		 */
		protected $strSvnWwwPath;
		const SvnWwwPathMaxLength = 250;
		const SvnWwwPathDefault = null;


		/**
		 * Protected member variable that maps to the database column mantis_project_table.ftp_pass
		 * @var string strFtpPass
		 */
		protected $strFtpPass;
		const FtpPassMaxLength = 45;
		const FtpPassDefault = null;


		/**
		 * Protected array of virtual attributes for this object (e.g. extra/other calculated and/or non-object bound
		 * columns from the run-time database query result for this object).  Used by InstantiateDbRow and
		 * GetVirtualAttribute.
		 * @var string[] $__strVirtualAttributeArray
		 */
		protected $__strVirtualAttributeArray = array();

		/**
		 * Protected internal member variable that specifies whether or not this object is Restored from the database.
		 * Used by Save() to determine if Save() should perform a db UPDATE or INSERT.
		 * @var bool __blnRestored;
		 */
		protected $__blnRestored;




		///////////////////////////////
		// PROTECTED MEMBER OBJECTS
		///////////////////////////////



		/**
		 * Initialize each property with default values from database definition
		 */
		public function Initialize()
		{
			$this->intId = MantisProjectTable::IdDefault;
			$this->strName = MantisProjectTable::NameDefault;
			$this->intStatus = MantisProjectTable::StatusDefault;
			$this->intEnabled = MantisProjectTable::EnabledDefault;
			$this->intViewState = MantisProjectTable::ViewStateDefault;
			$this->intAccessMin = MantisProjectTable::AccessMinDefault;
			$this->strFilePath = MantisProjectTable::FilePathDefault;
			$this->strDescription = MantisProjectTable::DescriptionDefault;
			$this->intCategoryId = MantisProjectTable::CategoryIdDefault;
			$this->intInheritGlobal = MantisProjectTable::InheritGlobalDefault;
			$this->strSvnPath = MantisProjectTable::SvnPathDefault;
			$this->strFtpUrl = MantisProjectTable::FtpUrlDefault;
			$this->strFtpWwwPath = MantisProjectTable::FtpWwwPathDefault;
			$this->strFtpUser = MantisProjectTable::FtpUserDefault;
			$this->strSvnWwwPath = MantisProjectTable::SvnWwwPathDefault;
			$this->strFtpPass = MantisProjectTable::FtpPassDefault;
		}


		///////////////////////////////
		// CLASS-WIDE LOAD AND COUNT METHODS
		///////////////////////////////

		/**
		 * Static method to retrieve the Database object that owns this class.
		 * @return QDatabaseBase reference to the Database object that can query this class
		 */
		public static function GetDatabase() {
			return QApplication::$Database[1];
		}

		/**
		 * Load a MantisProjectTable from PK Info
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return MantisProjectTable
		 */
		public static function Load($intId, $objOptionalClauses = null) {
			// Use QuerySingle to Perform the Query
			return MantisProjectTable::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::MantisProjectTable()->Id, $intId)
				),
				$objOptionalClauses
			);
		}

		/**
		 * Load all MantisProjectTables
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return MantisProjectTable[]
		 */
		public static function LoadAll($objOptionalClauses = null) {
			if (func_num_args() > 1) {
				throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
			}
			// Call MantisProjectTable::QueryArray to perform the LoadAll query
			try {
				return MantisProjectTable::QueryArray(QQ::All(), $objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count all MantisProjectTables
		 * @return int
		 */
		public static function CountAll() {
			// Call MantisProjectTable::QueryCount to perform the CountAll query
			return MantisProjectTable::QueryCount(QQ::All());
		}




		///////////////////////////////
		// QCUBED QUERY-RELATED METHODS
		///////////////////////////////

		/**
		 * Internally called method to assist with calling Qcubed Query for this class
		 * on load methods.
		 * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause object or array of QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
		 * @param boolean $blnCountOnly only select a rowcount
		 * @return string the query statement
		 */
		protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {
			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();

			// Create/Build out the QueryBuilder object with MantisProjectTable-specific SELET and FROM fields
			$objQueryBuilder = new QQueryBuilder($objDatabase, 'mantis_project_table');
			MantisProjectTable::GetSelectFields($objQueryBuilder);
			$objQueryBuilder->AddFromItem('mantis_project_table');

			// Set "CountOnly" option (if applicable)
			if ($blnCountOnly)
				$objQueryBuilder->SetCountOnlyFlag();

			// Apply Any Conditions
			if ($objConditions)
				try {
					$objConditions->UpdateQueryBuilder($objQueryBuilder);
				} catch (QCallerException $objExc) {
					$objExc->IncrementOffset();
					throw $objExc;
				}

			// Iterate through all the Optional Clauses (if any) and perform accordingly
			if ($objOptionalClauses) {
				if ($objOptionalClauses instanceof QQClause)
					$objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
				else if (is_array($objOptionalClauses))
					foreach ($objOptionalClauses as $objClause)
						$objClause->UpdateQueryBuilder($objQueryBuilder);
				else
					throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
			}

			// Get the SQL Statement
			$strQuery = $objQueryBuilder->GetStatement();

			// Prepare the Statement with the Query Parameters (if applicable)
			if ($mixParameterArray) {
				if (is_array($mixParameterArray)) {
					if (count($mixParameterArray))
						$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);

					// Ensure that there are no other Unresolved Named Parameters
					if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)
						throw new QCallerException('Unresolved named parameters in the query');
				} else
					throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
			}

			// Return the Objects
			return $strQuery;
		}

		/**
		 * Static Qcubed Query method to query for a single MantisProjectTable object.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return MantisProjectTable the queried object
		 */
		public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = MantisProjectTable::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query, Get the First Row, and Instantiate a new MantisProjectTable object
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);

			// Do we have to expand anything?
			if ($objQueryBuilder->ExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = MantisProjectTable::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
					if ($objItem)
						$objToReturn[] = $objItem;
				}
				if (count($objToReturn)) {
					// Since we only want the object to return, lets return the object and not the array.
					return $objToReturn[0];
				} else {
					return null;
				}
			} else {
				// No expands just return the first row
				$objDbRow = $objDbResult->GetNextRow();
				if(null === $objDbRow)
					return null;
				return MantisProjectTable::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
			}
		}

		/**
		 * Static Qcubed Query method to query for an array of MantisProjectTable objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return MantisProjectTable[] the queried objects as an array
		 */
		public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = MantisProjectTable::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and Instantiate the Array Result
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			return MantisProjectTable::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
		}

		/**
		 * Static Qcubed Query method to query for a count of MantisProjectTable objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return integer the count of queried objects as an integer
		 */
		public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = MantisProjectTable::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and return the row_count
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);

			// Figure out if the query is using GroupBy
			$blnGrouped = false;

			if ($objOptionalClauses) foreach ($objOptionalClauses as $objClause) {
				if ($objClause instanceof QQGroupBy) {
					$blnGrouped = true;
					break;
				}
			}

			if ($blnGrouped)
				// Groups in this query - return the count of Groups (which is the count of all rows)
				return $objDbResult->CountRows();
			else {
				// No Groups - return the sql-calculated count(*) value
				$strDbRow = $objDbResult->FetchRow();
				return QType::Cast($strDbRow[0], QType::Integer);
			}
		}

		public static function QueryArrayCached(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();

			$strQuery = MantisProjectTable::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);

			$objCache = new QCache('qquery/mantisprojecttable', $strQuery);
			$cacheData = $objCache->GetData();

			if (!$cacheData || $blnForceUpdate) {
				$objDbResult = $objQueryBuilder->Database->Query($strQuery);
				$arrResult = MantisProjectTable::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
				$objCache->SaveData(serialize($arrResult));
			} else {
				$arrResult = unserialize($cacheData);
			}

			return $arrResult;
		}

		/**
		 * Updates a QQueryBuilder with the SELECT fields for this MantisProjectTable
		 * @param QQueryBuilder $objBuilder the Query Builder object to update
		 * @param string $strPrefix optional prefix to add to the SELECT fields
		 */
		public static function GetSelectFields(QQueryBuilder $objBuilder, $strPrefix = null) {
			if ($strPrefix) {
				$strTableName = $strPrefix;
				$strAliasPrefix = $strPrefix . '__';
			} else {
				$strTableName = 'mantis_project_table';
				$strAliasPrefix = '';
			}

			$objBuilder->AddSelectItem($strTableName, 'id', $strAliasPrefix . 'id');
			$objBuilder->AddSelectItem($strTableName, 'name', $strAliasPrefix . 'name');
			$objBuilder->AddSelectItem($strTableName, 'status', $strAliasPrefix . 'status');
			$objBuilder->AddSelectItem($strTableName, 'enabled', $strAliasPrefix . 'enabled');
			$objBuilder->AddSelectItem($strTableName, 'view_state', $strAliasPrefix . 'view_state');
			$objBuilder->AddSelectItem($strTableName, 'access_min', $strAliasPrefix . 'access_min');
			$objBuilder->AddSelectItem($strTableName, 'file_path', $strAliasPrefix . 'file_path');
			$objBuilder->AddSelectItem($strTableName, 'description', $strAliasPrefix . 'description');
			$objBuilder->AddSelectItem($strTableName, 'category_id', $strAliasPrefix . 'category_id');
			$objBuilder->AddSelectItem($strTableName, 'inherit_global', $strAliasPrefix . 'inherit_global');
			$objBuilder->AddSelectItem($strTableName, 'svn_path', $strAliasPrefix . 'svn_path');
			$objBuilder->AddSelectItem($strTableName, 'ftp_url', $strAliasPrefix . 'ftp_url');
			$objBuilder->AddSelectItem($strTableName, 'ftp_www_path', $strAliasPrefix . 'ftp_www_path');
			$objBuilder->AddSelectItem($strTableName, 'ftp_user', $strAliasPrefix . 'ftp_user');
			$objBuilder->AddSelectItem($strTableName, 'svn_www_path', $strAliasPrefix . 'svn_www_path');
			$objBuilder->AddSelectItem($strTableName, 'ftp_pass', $strAliasPrefix . 'ftp_pass');
		}



		///////////////////////////////
		// INSTANTIATION-RELATED METHODS
		///////////////////////////////

		/**
		 * Instantiate a MantisProjectTable from a Database Row.
		 * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
		 * is calling this MantisProjectTable::InstantiateDbRow in order to perform
		 * early binding on referenced objects.
		 * @param DatabaseRowBase $objDbRow
		 * @param string $strAliasPrefix
		 * @param string $strExpandAsArrayNodes
		 * @param QBaseClass $arrPreviousItem
		 * @param string[] $strColumnAliasArray
		 * @return MantisProjectTable
		*/
		public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array()) {
			// If blank row, return null
			if (!$objDbRow) {
				return null;
			}

			// Create a new instance of the MantisProjectTable object
			$objToReturn = new MantisProjectTable();
			$objToReturn->__blnRestored = true;

			$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
			$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
			$objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'status', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'status'] : $strAliasPrefix . 'status';
			$objToReturn->intStatus = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'enabled', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'enabled'] : $strAliasPrefix . 'enabled';
			$objToReturn->intEnabled = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'view_state', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'view_state'] : $strAliasPrefix . 'view_state';
			$objToReturn->intViewState = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'access_min', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'access_min'] : $strAliasPrefix . 'access_min';
			$objToReturn->intAccessMin = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'file_path', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'file_path'] : $strAliasPrefix . 'file_path';
			$objToReturn->strFilePath = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
			$objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'category_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'category_id'] : $strAliasPrefix . 'category_id';
			$objToReturn->intCategoryId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'inherit_global', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'inherit_global'] : $strAliasPrefix . 'inherit_global';
			$objToReturn->intInheritGlobal = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'svn_path', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'svn_path'] : $strAliasPrefix . 'svn_path';
			$objToReturn->strSvnPath = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ftp_url', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ftp_url'] : $strAliasPrefix . 'ftp_url';
			$objToReturn->strFtpUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ftp_www_path', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ftp_www_path'] : $strAliasPrefix . 'ftp_www_path';
			$objToReturn->strFtpWwwPath = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ftp_user', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ftp_user'] : $strAliasPrefix . 'ftp_user';
			$objToReturn->strFtpUser = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'svn_www_path', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'svn_www_path'] : $strAliasPrefix . 'svn_www_path';
			$objToReturn->strSvnWwwPath = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'ftp_pass', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ftp_pass'] : $strAliasPrefix . 'ftp_pass';
			$objToReturn->strFtpPass = $objDbRow->GetColumn($strAliasName, 'VarChar');

			if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
				foreach ($arrPreviousItems as $objPreviousItem) {
					if ($objToReturn->Id != $objPreviousItem->Id) {
						continue;
					}

					// complete match - all primary key columns are the same
					return null;
				}
			}

			// Instantiate Virtual Attributes
			foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
				$strVirtualPrefix = $strAliasPrefix . '__';
				$strVirtualPrefixLength = strlen($strVirtualPrefix);
				if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
					$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
			}

			// Prepare to Check for Early/Virtual Binding
			if (!$strAliasPrefix)
				$strAliasPrefix = 'mantis_project_table__';




			return $objToReturn;
		}

		/**
		 * Instantiate an array of MantisProjectTables from a Database Result
		 * @param DatabaseResultBase $objDbResult
		 * @param string $strExpandAsArrayNodes
		 * @param string[] $strColumnAliasArray
		 * @return MantisProjectTable[]
		 */
		public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null, $strColumnAliasArray = null) {
			$objToReturn = array();

			if (!$strColumnAliasArray)
				$strColumnAliasArray = array();

			// If blank resultset, then return empty array
			if (!$objDbResult)
				return $objToReturn;

			// Load up the return array with each row
			if ($strExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = MantisProjectTable::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objToReturn, $strColumnAliasArray);
					if ($objItem) {
						$objToReturn[] = $objItem;
					}
				}
			} else {
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn[] = MantisProjectTable::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);
			}

			return $objToReturn;
		}



		///////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Single Load and Array)
		///////////////////////////////////////////////////
			
		/**
		 * Load a single MantisProjectTable object,
		 * by Id Index(es)
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return MantisProjectTable
		*/
		public static function LoadById($intId, $objOptionalClauses = null) {
			return MantisProjectTable::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::MantisProjectTable()->Id, $intId)
				),
				$objOptionalClauses
			);
		}
			
		/**
		 * Load a single MantisProjectTable object,
		 * by Name Index(es)
		 * @param string $strName
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return MantisProjectTable
		*/
		public static function LoadByName($strName, $objOptionalClauses = null) {
			return MantisProjectTable::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::MantisProjectTable()->Name, $strName)
				),
				$objOptionalClauses
			);
		}
			
		/**
		 * Load an array of MantisProjectTable objects,
		 * by ViewState Index(es)
		 * @param integer $intViewState
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return MantisProjectTable[]
		*/
		public static function LoadArrayByViewState($intViewState, $objOptionalClauses = null) {
			// Call MantisProjectTable::QueryArray to perform the LoadArrayByViewState query
			try {
				return MantisProjectTable::QueryArray(
					QQ::Equal(QQN::MantisProjectTable()->ViewState, $intViewState),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count MantisProjectTables
		 * by ViewState Index(es)
		 * @param integer $intViewState
		 * @return int
		*/
		public static function CountByViewState($intViewState) {
			// Call MantisProjectTable::QueryCount to perform the CountByViewState query
			return MantisProjectTable::QueryCount(
				QQ::Equal(QQN::MantisProjectTable()->ViewState, $intViewState)
			);
		}



		////////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Array via Many to Many)
		////////////////////////////////////////////////////




		//////////////////////////
		// SAVE, DELETE AND RELOAD
		//////////////////////////

		/**
		 * Save this MantisProjectTable
		 * @param bool $blnForceInsert
		 * @param bool $blnForceUpdate
		 * @return int
		 */
		public function Save($blnForceInsert = false, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();

			$mixToReturn = null;

			try {
				if ((!$this->__blnRestored) || ($blnForceInsert)) {
					// Perform an INSERT query
					$objDatabase->NonQuery('
						INSERT INTO `mantis_project_table` (
							`name`,
							`status`,
							`enabled`,
							`view_state`,
							`access_min`,
							`file_path`,
							`description`,
							`category_id`,
							`inherit_global`,
							`svn_path`,
							`ftp_url`,
							`ftp_www_path`,
							`ftp_user`,
							`svn_www_path`,
							`ftp_pass`
						) VALUES (
							' . $objDatabase->SqlVariable($this->strName) . ',
							' . $objDatabase->SqlVariable($this->intStatus) . ',
							' . $objDatabase->SqlVariable($this->intEnabled) . ',
							' . $objDatabase->SqlVariable($this->intViewState) . ',
							' . $objDatabase->SqlVariable($this->intAccessMin) . ',
							' . $objDatabase->SqlVariable($this->strFilePath) . ',
							' . $objDatabase->SqlVariable($this->strDescription) . ',
							' . $objDatabase->SqlVariable($this->intCategoryId) . ',
							' . $objDatabase->SqlVariable($this->intInheritGlobal) . ',
							' . $objDatabase->SqlVariable($this->strSvnPath) . ',
							' . $objDatabase->SqlVariable($this->strFtpUrl) . ',
							' . $objDatabase->SqlVariable($this->strFtpWwwPath) . ',
							' . $objDatabase->SqlVariable($this->strFtpUser) . ',
							' . $objDatabase->SqlVariable($this->strSvnWwwPath) . ',
							' . $objDatabase->SqlVariable($this->strFtpPass) . '
						)
					');

					// Update Identity column and return its value
					$mixToReturn = $this->intId = $objDatabase->InsertId('mantis_project_table', 'id');
				} else {
					// Perform an UPDATE query

					// First checking for Optimistic Locking constraints (if applicable)

					// Perform the UPDATE query
					$objDatabase->NonQuery('
						UPDATE
							`mantis_project_table`
						SET
							`name` = ' . $objDatabase->SqlVariable($this->strName) . ',
							`status` = ' . $objDatabase->SqlVariable($this->intStatus) . ',
							`enabled` = ' . $objDatabase->SqlVariable($this->intEnabled) . ',
							`view_state` = ' . $objDatabase->SqlVariable($this->intViewState) . ',
							`access_min` = ' . $objDatabase->SqlVariable($this->intAccessMin) . ',
							`file_path` = ' . $objDatabase->SqlVariable($this->strFilePath) . ',
							`description` = ' . $objDatabase->SqlVariable($this->strDescription) . ',
							`category_id` = ' . $objDatabase->SqlVariable($this->intCategoryId) . ',
							`inherit_global` = ' . $objDatabase->SqlVariable($this->intInheritGlobal) . ',
							`svn_path` = ' . $objDatabase->SqlVariable($this->strSvnPath) . ',
							`ftp_url` = ' . $objDatabase->SqlVariable($this->strFtpUrl) . ',
							`ftp_www_path` = ' . $objDatabase->SqlVariable($this->strFtpWwwPath) . ',
							`ftp_user` = ' . $objDatabase->SqlVariable($this->strFtpUser) . ',
							`svn_www_path` = ' . $objDatabase->SqlVariable($this->strSvnWwwPath) . ',
							`ftp_pass` = ' . $objDatabase->SqlVariable($this->strFtpPass) . '
						WHERE
							`id` = ' . $objDatabase->SqlVariable($this->intId) . '
					');
				}

			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Update __blnRestored and any Non-Identity PK Columns (if applicable)
			$this->__blnRestored = true;


			// Return
			return $mixToReturn;
		}

		/**
		 * Delete this MantisProjectTable
		 * @return void
		 */
		public function Delete() {
			if ((is_null($this->intId)))
				throw new QUndefinedPrimaryKeyException('Cannot delete this MantisProjectTable with an unset primary key.');

			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();


			// Perform the SQL Query
			$objDatabase->NonQuery('
				DELETE FROM
					`mantis_project_table`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($this->intId) . '');
		}

		/**
		 * Delete all MantisProjectTables
		 * @return void
		 */
		public static function DeleteAll() {
			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				DELETE FROM
					`mantis_project_table`');
		}

		/**
		 * Truncate mantis_project_table table
		 * @return void
		 */
		public static function Truncate() {
			// Get the Database Object for this Class
			$objDatabase = MantisProjectTable::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				TRUNCATE `mantis_project_table`');
		}

		/**
		 * Reload this MantisProjectTable from the database.
		 * @return void
		 */
		public function Reload() {
			// Make sure we are actually Restored from the database
			if (!$this->__blnRestored)
				throw new QCallerException('Cannot call Reload() on a new, unsaved MantisProjectTable object.');

			// Reload the Object
			$objReloaded = MantisProjectTable::Load($this->intId);

			// Update $this's local variables to match
			$this->strName = $objReloaded->strName;
			$this->intStatus = $objReloaded->intStatus;
			$this->intEnabled = $objReloaded->intEnabled;
			$this->intViewState = $objReloaded->intViewState;
			$this->intAccessMin = $objReloaded->intAccessMin;
			$this->strFilePath = $objReloaded->strFilePath;
			$this->strDescription = $objReloaded->strDescription;
			$this->intCategoryId = $objReloaded->intCategoryId;
			$this->intInheritGlobal = $objReloaded->intInheritGlobal;
			$this->strSvnPath = $objReloaded->strSvnPath;
			$this->strFtpUrl = $objReloaded->strFtpUrl;
			$this->strFtpWwwPath = $objReloaded->strFtpWwwPath;
			$this->strFtpUser = $objReloaded->strFtpUser;
			$this->strSvnWwwPath = $objReloaded->strSvnWwwPath;
			$this->strFtpPass = $objReloaded->strFtpPass;
		}



		////////////////////
		// PUBLIC OVERRIDERS
		////////////////////

				/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Id':
					/**
					 * Gets the value for intId (Read-Only PK)
					 * @return integer
					 */
					return $this->intId;

				case 'Name':
					/**
					 * Gets the value for strName (Unique)
					 * @return string
					 */
					return $this->strName;

				case 'Status':
					/**
					 * Gets the value for intStatus (Not Null)
					 * @return integer
					 */
					return $this->intStatus;

				case 'Enabled':
					/**
					 * Gets the value for intEnabled (Not Null)
					 * @return integer
					 */
					return $this->intEnabled;

				case 'ViewState':
					/**
					 * Gets the value for intViewState (Not Null)
					 * @return integer
					 */
					return $this->intViewState;

				case 'AccessMin':
					/**
					 * Gets the value for intAccessMin (Not Null)
					 * @return integer
					 */
					return $this->intAccessMin;

				case 'FilePath':
					/**
					 * Gets the value for strFilePath (Not Null)
					 * @return string
					 */
					return $this->strFilePath;

				case 'Description':
					/**
					 * Gets the value for strDescription (Not Null)
					 * @return string
					 */
					return $this->strDescription;

				case 'CategoryId':
					/**
					 * Gets the value for intCategoryId (Not Null)
					 * @return integer
					 */
					return $this->intCategoryId;

				case 'InheritGlobal':
					/**
					 * Gets the value for intInheritGlobal (Not Null)
					 * @return integer
					 */
					return $this->intInheritGlobal;

				case 'SvnPath':
					/**
					 * Gets the value for strSvnPath 
					 * @return string
					 */
					return $this->strSvnPath;

				case 'FtpUrl':
					/**
					 * Gets the value for strFtpUrl 
					 * @return string
					 */
					return $this->strFtpUrl;

				case 'FtpWwwPath':
					/**
					 * Gets the value for strFtpWwwPath 
					 * @return string
					 */
					return $this->strFtpWwwPath;

				case 'FtpUser':
					/**
					 * Gets the value for strFtpUser 
					 * @return string
					 */
					return $this->strFtpUser;

				case 'SvnWwwPath':
					/**
					 * Gets the value for strSvnWwwPath 
					 * @return string
					 */
					return $this->strSvnWwwPath;

				case 'FtpPass':
					/**
					 * Gets the value for strFtpPass 
					 * @return string
					 */
					return $this->strFtpPass;


				///////////////////
				// Member Objects
				///////////////////

				////////////////////////////
				// Virtual Object References (Many to Many and Reverse References)
				// (If restored via a "Many-to" expansion)
				////////////////////////////


				case '__Restored':
					return $this->__blnRestored;

				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

				/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Name':
					/**
					 * Sets the value for strName (Unique)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strName = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Status':
					/**
					 * Sets the value for intStatus (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intStatus = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Enabled':
					/**
					 * Sets the value for intEnabled (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intEnabled = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ViewState':
					/**
					 * Sets the value for intViewState (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intViewState = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'AccessMin':
					/**
					 * Sets the value for intAccessMin (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intAccessMin = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FilePath':
					/**
					 * Sets the value for strFilePath (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strFilePath = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Description':
					/**
					 * Sets the value for strDescription (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strDescription = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'CategoryId':
					/**
					 * Sets the value for intCategoryId (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intCategoryId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'InheritGlobal':
					/**
					 * Sets the value for intInheritGlobal (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intInheritGlobal = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'SvnPath':
					/**
					 * Sets the value for strSvnPath 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strSvnPath = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FtpUrl':
					/**
					 * Sets the value for strFtpUrl 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strFtpUrl = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FtpWwwPath':
					/**
					 * Sets the value for strFtpWwwPath 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strFtpWwwPath = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FtpUser':
					/**
					 * Sets the value for strFtpUser 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strFtpUser = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'SvnWwwPath':
					/**
					 * Sets the value for strSvnWwwPath 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strSvnWwwPath = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FtpPass':
					/**
					 * Sets the value for strFtpPass 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strFtpPass = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				///////////////////
				// Member Objects
				///////////////////
				default:
					try {
						return parent::__set($strName, $mixValue);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Lookup a VirtualAttribute value (if applicable).  Returns NULL if none found.
		 * @param string $strName
		 * @return string
		 */
		public function GetVirtualAttribute($strName) {
			if (array_key_exists($strName, $this->__strVirtualAttributeArray))
				return $this->__strVirtualAttributeArray[$strName];
			return null;
		}



		///////////////////////////////
		// ASSOCIATED OBJECTS' METHODS
		///////////////////////////////





		////////////////////////////////////////
		// METHODS for SOAP-BASED WEB SERVICES
		////////////////////////////////////////

		public static function GetSoapComplexTypeXml() {
			$strToReturn = '<complexType name="MantisProjectTable"><sequence>';
			$strToReturn .= '<element name="Id" type="xsd:int"/>';
			$strToReturn .= '<element name="Name" type="xsd:string"/>';
			$strToReturn .= '<element name="Status" type="xsd:int"/>';
			$strToReturn .= '<element name="Enabled" type="xsd:int"/>';
			$strToReturn .= '<element name="ViewState" type="xsd:int"/>';
			$strToReturn .= '<element name="AccessMin" type="xsd:int"/>';
			$strToReturn .= '<element name="FilePath" type="xsd:string"/>';
			$strToReturn .= '<element name="Description" type="xsd:string"/>';
			$strToReturn .= '<element name="CategoryId" type="xsd:int"/>';
			$strToReturn .= '<element name="InheritGlobal" type="xsd:int"/>';
			$strToReturn .= '<element name="SvnPath" type="xsd:string"/>';
			$strToReturn .= '<element name="FtpUrl" type="xsd:string"/>';
			$strToReturn .= '<element name="FtpWwwPath" type="xsd:string"/>';
			$strToReturn .= '<element name="FtpUser" type="xsd:string"/>';
			$strToReturn .= '<element name="SvnWwwPath" type="xsd:string"/>';
			$strToReturn .= '<element name="FtpPass" type="xsd:string"/>';
			$strToReturn .= '<element name="__blnRestored" type="xsd:boolean"/>';
			$strToReturn .= '</sequence></complexType>';
			return $strToReturn;
		}

		public static function AlterSoapComplexTypeArray(&$strComplexTypeArray) {
			if (!array_key_exists('MantisProjectTable', $strComplexTypeArray)) {
				$strComplexTypeArray['MantisProjectTable'] = MantisProjectTable::GetSoapComplexTypeXml();
			}
		}

		public static function GetArrayFromSoapArray($objSoapArray) {
			$objArrayToReturn = array();

			foreach ($objSoapArray as $objSoapObject)
				array_push($objArrayToReturn, MantisProjectTable::GetObjectFromSoapObject($objSoapObject));

			return $objArrayToReturn;
		}

		public static function GetObjectFromSoapObject($objSoapObject) {
			$objToReturn = new MantisProjectTable();
			if (property_exists($objSoapObject, 'Id'))
				$objToReturn->intId = $objSoapObject->Id;
			if (property_exists($objSoapObject, 'Name'))
				$objToReturn->strName = $objSoapObject->Name;
			if (property_exists($objSoapObject, 'Status'))
				$objToReturn->intStatus = $objSoapObject->Status;
			if (property_exists($objSoapObject, 'Enabled'))
				$objToReturn->intEnabled = $objSoapObject->Enabled;
			if (property_exists($objSoapObject, 'ViewState'))
				$objToReturn->intViewState = $objSoapObject->ViewState;
			if (property_exists($objSoapObject, 'AccessMin'))
				$objToReturn->intAccessMin = $objSoapObject->AccessMin;
			if (property_exists($objSoapObject, 'FilePath'))
				$objToReturn->strFilePath = $objSoapObject->FilePath;
			if (property_exists($objSoapObject, 'Description'))
				$objToReturn->strDescription = $objSoapObject->Description;
			if (property_exists($objSoapObject, 'CategoryId'))
				$objToReturn->intCategoryId = $objSoapObject->CategoryId;
			if (property_exists($objSoapObject, 'InheritGlobal'))
				$objToReturn->intInheritGlobal = $objSoapObject->InheritGlobal;
			if (property_exists($objSoapObject, 'SvnPath'))
				$objToReturn->strSvnPath = $objSoapObject->SvnPath;
			if (property_exists($objSoapObject, 'FtpUrl'))
				$objToReturn->strFtpUrl = $objSoapObject->FtpUrl;
			if (property_exists($objSoapObject, 'FtpWwwPath'))
				$objToReturn->strFtpWwwPath = $objSoapObject->FtpWwwPath;
			if (property_exists($objSoapObject, 'FtpUser'))
				$objToReturn->strFtpUser = $objSoapObject->FtpUser;
			if (property_exists($objSoapObject, 'SvnWwwPath'))
				$objToReturn->strSvnWwwPath = $objSoapObject->SvnWwwPath;
			if (property_exists($objSoapObject, 'FtpPass'))
				$objToReturn->strFtpPass = $objSoapObject->FtpPass;
			if (property_exists($objSoapObject, '__blnRestored'))
				$objToReturn->__blnRestored = $objSoapObject->__blnRestored;
			return $objToReturn;
		}

		public static function GetSoapArrayFromArray($objArray) {
			if (!$objArray)
				return null;

			$objArrayToReturn = array();

			foreach ($objArray as $objObject)
				array_push($objArrayToReturn, MantisProjectTable::GetSoapObjectFromObject($objObject, true));

			return unserialize(serialize($objArrayToReturn));
		}

		public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) {
			return $objObject;
		}


		////////////////////////////////////////
		// METHODS for JSON Object Translation
		////////////////////////////////////////

		// this function is required for objects that implement the
		// IteratorAggregate interface
		public function getIterator() {
			///////////////////
			// Member Variables
			///////////////////
			$iArray['Id'] = $this->intId;
			$iArray['Name'] = $this->strName;
			$iArray['Status'] = $this->intStatus;
			$iArray['Enabled'] = $this->intEnabled;
			$iArray['ViewState'] = $this->intViewState;
			$iArray['AccessMin'] = $this->intAccessMin;
			$iArray['FilePath'] = $this->strFilePath;
			$iArray['Description'] = $this->strDescription;
			$iArray['CategoryId'] = $this->intCategoryId;
			$iArray['InheritGlobal'] = $this->intInheritGlobal;
			$iArray['SvnPath'] = $this->strSvnPath;
			$iArray['FtpUrl'] = $this->strFtpUrl;
			$iArray['FtpWwwPath'] = $this->strFtpWwwPath;
			$iArray['FtpUser'] = $this->strFtpUser;
			$iArray['SvnWwwPath'] = $this->strSvnWwwPath;
			$iArray['FtpPass'] = $this->strFtpPass;
			return new ArrayIterator($iArray);
		}

		// this function returns a Json formatted string using the
		// IteratorAggregate interface
		public function getJson() {
			return json_encode($this->getIterator());
		}


	}



	/////////////////////////////////////
	// ADDITIONAL CLASSES for QCubed QUERY
	/////////////////////////////////////

    /**
     * @uses QQNode
     *
     * @property-read QQNode $Id
     * @property-read QQNode $Name
     * @property-read QQNode $Status
     * @property-read QQNode $Enabled
     * @property-read QQNode $ViewState
     * @property-read QQNode $AccessMin
     * @property-read QQNode $FilePath
     * @property-read QQNode $Description
     * @property-read QQNode $CategoryId
     * @property-read QQNode $InheritGlobal
     * @property-read QQNode $SvnPath
     * @property-read QQNode $FtpUrl
     * @property-read QQNode $FtpWwwPath
     * @property-read QQNode $FtpUser
     * @property-read QQNode $SvnWwwPath
     * @property-read QQNode $FtpPass
     *
     *

     * @property-read QQNode $_PrimaryKeyNode
     **/
	class QQNodeMantisProjectTable extends QQNode {
		protected $strTableName = 'mantis_project_table';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'MantisProjectTable';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'Integer', $this);
				case 'Name':
					return new QQNode('name', 'Name', 'VarChar', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'Integer', $this);
				case 'Enabled':
					return new QQNode('enabled', 'Enabled', 'Integer', $this);
				case 'ViewState':
					return new QQNode('view_state', 'ViewState', 'Integer', $this);
				case 'AccessMin':
					return new QQNode('access_min', 'AccessMin', 'Integer', $this);
				case 'FilePath':
					return new QQNode('file_path', 'FilePath', 'VarChar', $this);
				case 'Description':
					return new QQNode('description', 'Description', 'Blob', $this);
				case 'CategoryId':
					return new QQNode('category_id', 'CategoryId', 'Integer', $this);
				case 'InheritGlobal':
					return new QQNode('inherit_global', 'InheritGlobal', 'Integer', $this);
				case 'SvnPath':
					return new QQNode('svn_path', 'SvnPath', 'VarChar', $this);
				case 'FtpUrl':
					return new QQNode('ftp_url', 'FtpUrl', 'VarChar', $this);
				case 'FtpWwwPath':
					return new QQNode('ftp_www_path', 'FtpWwwPath', 'VarChar', $this);
				case 'FtpUser':
					return new QQNode('ftp_user', 'FtpUser', 'VarChar', $this);
				case 'SvnWwwPath':
					return new QQNode('svn_www_path', 'SvnWwwPath', 'VarChar', $this);
				case 'FtpPass':
					return new QQNode('ftp_pass', 'FtpPass', 'VarChar', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'Integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

    /**
     * @property-read QQNode $Id
     * @property-read QQNode $Name
     * @property-read QQNode $Status
     * @property-read QQNode $Enabled
     * @property-read QQNode $ViewState
     * @property-read QQNode $AccessMin
     * @property-read QQNode $FilePath
     * @property-read QQNode $Description
     * @property-read QQNode $CategoryId
     * @property-read QQNode $InheritGlobal
     * @property-read QQNode $SvnPath
     * @property-read QQNode $FtpUrl
     * @property-read QQNode $FtpWwwPath
     * @property-read QQNode $FtpUser
     * @property-read QQNode $SvnWwwPath
     * @property-read QQNode $FtpPass
     *
     *

     * @property-read QQNode $_PrimaryKeyNode
     **/
	class QQReverseReferenceNodeMantisProjectTable extends QQReverseReferenceNode {
		protected $strTableName = 'mantis_project_table';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'MantisProjectTable';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'Name':
					return new QQNode('name', 'Name', 'string', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'integer', $this);
				case 'Enabled':
					return new QQNode('enabled', 'Enabled', 'integer', $this);
				case 'ViewState':
					return new QQNode('view_state', 'ViewState', 'integer', $this);
				case 'AccessMin':
					return new QQNode('access_min', 'AccessMin', 'integer', $this);
				case 'FilePath':
					return new QQNode('file_path', 'FilePath', 'string', $this);
				case 'Description':
					return new QQNode('description', 'Description', 'string', $this);
				case 'CategoryId':
					return new QQNode('category_id', 'CategoryId', 'integer', $this);
				case 'InheritGlobal':
					return new QQNode('inherit_global', 'InheritGlobal', 'integer', $this);
				case 'SvnPath':
					return new QQNode('svn_path', 'SvnPath', 'string', $this);
				case 'FtpUrl':
					return new QQNode('ftp_url', 'FtpUrl', 'string', $this);
				case 'FtpWwwPath':
					return new QQNode('ftp_www_path', 'FtpWwwPath', 'string', $this);
				case 'FtpUser':
					return new QQNode('ftp_user', 'FtpUser', 'string', $this);
				case 'SvnWwwPath':
					return new QQNode('svn_www_path', 'SvnWwwPath', 'string', $this);
				case 'FtpPass':
					return new QQNode('ftp_pass', 'FtpPass', 'string', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

?>
